<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>键盘事件</title>
    <script type="text/javascript" src="../js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript">
        $(document).keydown(function (event) {
            //按回车键时触发（keyCode为13时，表示回车键）
            if(event.keyCode == "13"){
                alert("您按下了回车键！！")
            }
        })
    </script>
</head>
<body>

</body>
</html>